/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.net.greenet.logmanage.logic.bean;

import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import java.sql.Timestamp;

/**
 *
 * @author dongqiang
 */
@DatabaseTable(tableName="MessageInComingLog")
public class MessageInComingLogBean {
    public static final String ID = "id";
    public static final String MESSAGE_TYPE = "messageType";
    public static final String MESSAGE_NO = "messageNo";
    public static final String MESSAGE_SEQUENCE_NO = "messageSequenceNo";
    public static final String MESSAGE_SERIAL_NO = "messageSerialNo";
    public static final String FROM_IP = "fromIP";
    public static final String PACKET = "packet";
    public static final String RECEIVE_TIME = "time";
    public static final String DPI_ENDPOINT_BEAN_ID = "DPIEndPointBean_id";
    
    @DatabaseField(columnName=ID, id=true)
    private long id;
    @DatabaseField(columnName=MESSAGE_TYPE)
    private String messageType;
    @DatabaseField(columnName=MESSAGE_NO)
    private int messageNo;
    @DatabaseField(columnName=MESSAGE_SEQUENCE_NO)
    private long messageSequenceNo;
    @DatabaseField(columnName=MESSAGE_SERIAL_NO)
    private long messageSerialNo;
    @DatabaseField(columnName=FROM_IP)
    private String fromIP;
    @DatabaseField(columnName=PACKET, dataType=DataType.BYTE_ARRAY)
    private byte[] packet;
    @DatabaseField(columnName=RECEIVE_TIME, dataType=DataType.TIME_STAMP)
    private Timestamp time;
    @DatabaseField(columnName=DPI_ENDPOINT_BEAN_ID, foreign=true)
    private DPIEndPointBean dpi;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getMessageType() {
        return messageType;
    }

    public void setMessageType(String messageType) {
        this.messageType = messageType;
    }

    public int getMessageNo() {
        return messageNo;
    }

    public void setMessageNo(int messageNo) {
        this.messageNo = messageNo;
    }

    public long getMessageSequenceNo() {
        return messageSequenceNo;
    }

    public void setMessageSequenceNo(long messageSequenceNo) {
        this.messageSequenceNo = messageSequenceNo;
    }

    public long getMessageSerialNo() {
        return messageSerialNo;
    }

    public void setMessageSerialNo(long messageSerialNo) {
        this.messageSerialNo = messageSerialNo;
    }

    public String getFromIP() {
        return fromIP;
    }

    public void setFromIP(String fromIP) {
        this.fromIP = fromIP;
    }

    public byte[] getPacket() {
        return packet;
    }

    public void setPacket(byte[] packet) {
        this.packet = packet;
    }

    public Timestamp getTime() {
        return time;
    }

    public void setTime(Timestamp time) {
        this.time = time;
    }

    public DPIEndPointBean getDpi() {
        return dpi;
    }

    public void setDpi(DPIEndPointBean dpi) {
        this.dpi = dpi;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null || obj.getClass() != getClass()) {
            return false;
        }
        return id == ((MessageInComingLogBean)obj).id;
    }
    
}
